var city = [];
var yanglao = [];
var yiliao = [];
var fuliyuan = [];
var fuwu = [];

var year;
var url = location.search; //获取url中"?"符后的字串
if (url.indexOf("?") != -1) {
    year = decodeURI(url.substr(1).split("=")[1]);
}

$.ajax({
    type: "post",
    async: false,            //异步请求（同步请求将会锁住浏览器，用户其他操作必须等待请求完成才可以执行）
    url: "ZhejiangGuaranteeServlet?year=" + year,    //请求发送到TestServlet处
    data: {},
    dataType: "json",
    //返回数据形式为json
    success: function (json) {

        //请求成功时执行该函数内容，result即为服务器返回的json对象
        if (json) {

            for (var key in json[0]) {

                if (key == "养老") {
                    yanglao = json[0][key].split(',');
                }
                if (key == "医疗") {
                    yiliao = json[0][key].split(',');
                }
                if (key == "福利院") {
                    fuliyuan = json[0][key].split(',');
                }
                if (key == "服务设施") {
                    fuwu = json[0][key].split(',');
                }
                if (key == "城市") {
                    city = json[0][key].split(',');
                }

            }
        }
    }
});